import request from '@/config/axios'

// 报警清单 VO
export interface AlarmListVO {
  id: number // 序号
  diagnosisCategory: string // 诊断类别
  diagnosisContent: string // 诊断内容
  alarmStatus: string // 报警状态
  closer: string // 关闭人
  closingDescription: string // 关闭说明
  closingDate: Date // 关闭日期
}

// 报警清单 API
export const AlarmListApi = {
  // 查询报警清单分页
  getAlarmListPage: async (params: any) => {
    return await request.get({ url: `/om/alarm-list/page`, params })
  },

  // 查询报警清单详情
  getAlarmList: async (id: number) => {
    return await request.get({ url: `/om/alarm-list/get?id=` + id })
  },

  // 新增报警清单
  createAlarmList: async (data: AlarmListVO) => {
    return await request.post({ url: `/om/alarm-list/create`, data })
  },

  // 修改报警清单
  updateAlarmList: async (data: AlarmListVO) => {
    return await request.put({ url: `/om/alarm-list/update`, data })
  },

  // 删除报警清单
  deleteAlarmList: async (id: number) => {
    return await request.delete({ url: `/om/alarm-list/delete?id=` + id })
  },

  // 导出报警清单 Excel
  exportAlarmList: async (params) => {
    return await request.download({ url: `/om/alarm-list/export-excel`, params })
  },
}